#include "Goalie.h"
#include "../SGD Wrappers/DestroyEntityMessage.h"


CGoalie::CGoalie()
{
	m_fLifeTimer = 15;
}


CGoalie::~CGoalie()
{
}

void CGoalie::Update(float elapsedTime) /*override*/
{
	if (m_ptPosition.y <= 224)
		m_vtVelocity.y = 96;
	else if (m_ptPosition.y >= 320)
		m_vtVelocity.y = -96;

	m_fLifeTimer -= elapsedTime;

	if (m_fLifeTimer <= 0)
	{
		DestroyEntityMessage* pMsg = new DestroyEntityMessage(this);
		pMsg->QueueMessage();
	}

	CAgent::Update(elapsedTime);
}